using Dew.Math;
using Dew.Math.Units;
using Dew.Signal;
using Dew.Signal.Units;
using Dew.Math.Tee;
using Dew.Signal.Tee;
private void button1_Click(
object sender, EventArgs e)
{
Vector h =
MtxExpr.Sin(
MtxExpr.Ramp(256, TMtxFloatPrecision.mvDouble,0, 2 *
Math387.PI * 0.1));
Vector h1 =
new Vector(0);
Vector Response =
new Vector(0);
Vector Response1 =
new Vector(0);
h1.Copy(h);
SignalUtils.BlackmanExact(h, TSignalWindowMode.wmSymmetric);
//window the sinc impulse response
MtxVecTee.DrawIt(h,"",
false);
h = h * 2.344168;
//scale the signal to compensate for energy loss
SignalUtils.FrequencyResponse(h1,
null, Response,8,
false, TSignalWindowType.wtRectangular, 0);
SignalUtils.FrequencyResponse(h,
null, Response1, 8,
false, TSignalWindowType.wtRectangular, 0);
MtxVecTee.DrawIt(
new TVec[2] { Response, Response1 },
new string[2] { "Rectangular window", "Exact blackman" }, "Frequency response",
false);
}